package com.ruoyi.swap.openapi.orderbook.service.impl;

import java.util.List;

import com.ruoyi.spot.openapi.orderbook.domain.VO.SpotOpenapiOrderbookVO;
import com.ruoyi.swap.openapi.orderbook.domain.VO.SwapOpenapiOrderbookVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.swap.openapi.orderbook.mapper.SwapOpenapiOrderbookMapper;
import com.ruoyi.swap.openapi.orderbook.domain.SwapOpenapiOrderbook;
import com.ruoyi.swap.openapi.orderbook.service.ISwapOpenapiOrderbookService;

/**
 * 订单簿Service业务层处理
 * 
 * @author saumell
 * @date 2024-08-19
 */
@Service
public class SwapOpenapiOrderbookServiceImpl implements ISwapOpenapiOrderbookService 
{
    @Autowired
    private SwapOpenapiOrderbookMapper swapOpenapiOrderbookMapper;

    /**
     * 查询订单簿
     * 
     * @param id 订单簿主键
     * @return 订单簿
     */
    @Override
    public SwapOpenapiOrderbookVO selectSwapOpenapiOrderbookById(Integer id)
    {
        return swapOpenapiOrderbookMapper.selectSwapOpenapiOrderbookById(id);
    }

    /**
     * 查询订单簿列表
     * 
     * @param swapOpenapiOrderbook 订单簿
     * @return 订单簿
     */
    @Override
    public List<SwapOpenapiOrderbookVO> selectSwapOpenapiOrderbookList(SwapOpenapiOrderbookVO swapOpenapiOrderbook)
    {
        return swapOpenapiOrderbookMapper.selectSwapOpenapiOrderbookList(swapOpenapiOrderbook);
    }

    /**
     * 新增订单簿
     * 
     * @param swapOpenapiOrderbook 订单簿
     * @return 结果
     */
    @Override
    public int insertSwapOpenapiOrderbook(SwapOpenapiOrderbook swapOpenapiOrderbook)
    {
        return swapOpenapiOrderbookMapper.insertSwapOpenapiOrderbook(swapOpenapiOrderbook);
    }

    /**
     * 修改订单簿
     * 
     * @param swapOpenapiOrderbook 订单簿
     * @return 结果
     */
    @Override
    public int updateSwapOpenapiOrderbook(SwapOpenapiOrderbook swapOpenapiOrderbook)
    {
        return swapOpenapiOrderbookMapper.updateSwapOpenapiOrderbook(swapOpenapiOrderbook);
    }

    /**
     * 批量删除订单簿
     * 
     * @param ids 需要删除的订单簿主键
     * @return 结果
     */
    @Override
    public int deleteSwapOpenapiOrderbookByIds(Integer[] ids)
    {
        return swapOpenapiOrderbookMapper.deleteSwapOpenapiOrderbookByIds(ids);
    }

    /**
     * 删除订单簿信息
     * 
     * @param id 订单簿主键
     * @return 结果
     */
    @Override
    public int deleteSwapOpenapiOrderbookById(Integer id)
    {
        return swapOpenapiOrderbookMapper.deleteSwapOpenapiOrderbookById(id);
    }


    @Override
    public List<SwapOpenapiOrderbookVO> selectSwapAllData() {
        return swapOpenapiOrderbookMapper.selectSwapAllData();
    }

    @Override
    public Integer queryCurryNumber(String currencyPair) {
        return swapOpenapiOrderbookMapper.queryCurryNumber(currencyPair);
    }
}
